package account

import (
	"demo/internal/enums"
	"demo/internal/model/entity"
	"github.com/gogf/gf/v2/frame/g"
)

type GetListReq struct {
	g.Meta   `path:"/account/getList" tags:"用户管理" method:"get" summary:"用户列表"`
	Username string `p:"username"`
}

type GetListRes struct {
	g.Meta `mime:"application/json"`
	List   []*entity.Account `json:"list"`
	Total  interface{}       `json:"total"`
}

type AddReq struct {
	g.Meta             `path:"/account/add" tags:"用户管理" method:"post" summary:"编辑用户"`
	Email              string                   `p:"email" v:"required|email#邮箱不能为空|邮箱格式不正确"`
	AccountName        string                   `p:"accountName" v:"required#中文名不能为空"`
	EnName             string                   `p:"enName" v:"required#英文名不能为空"`
	Sex                enums.Sex                `p:"sex" v:"enums#不合符规定内容"`
	Address            string                   `p:"address" v:"required#地址不能为空"`
	Phone              string                   `p:"phone" v:"phone#格式不正确"`
	DepartmentIds      []int                    `p:"departmentIds" v:"required|array#部门组别不能为空|格式不正确"`
	RoleId             int                      `p:"roleId" v:"required#角色不能为空"`
	DepartmentIdentity enums.DepartmentIdentity `p:"departmentIdentity" v:"required#部门身份不能为空"`
}

type AddRes struct {
	g.Meta `mime:"application/json"`
}

type UpdateReq struct {
	g.Meta             `path:"/account/update" tags:"用户管理" method:"post" summary:"编辑用户"`
	AccountId          int                      `p:"accountId" v:"required#账号id不能为空"`
	AccountName        string                   `p:"accountName" v:"required#中文名不能为空"`
	EnName             string                   `p:"enName" v:"required#英文名不能为空"`
	Sex                enums.Sex                `p:"sex" v:"enums#不合符规定内容"`
	Address            string                   `p:"address" v:"required#地址不能为空"`
	Phone              string                   `p:"phone" v:"phone#格式不正确"`
	DepartmentIds      []int                    `p:"departmentIds" v:"required|array#部门组别不能为空|格式不正确"`
	RoleId             int                      `p:"roleId" v:"required#角色不能为空"`
	DepartmentIdentity enums.DepartmentIdentity `p:"departmentIdentity" v:"required#部门身份不能为空"`
}

type UpdateRes struct {
	g.Meta `mime:"application/json"`
}

type SateReq struct {
	g.Meta    `path:"/account/state" tags:"用户管理" method:"post" summary:"设置用户状态"`
	AccountId int               `p:"accountId" v:"required#账号id不能为空"`
	State     enums.AccountSate `p:"state" v:"required|enums#状态不能为空|不合符规定内容"`
}

type SateRes struct {
	g.Meta `mime:"application/json"`
}
